<template>
	<view class="hospital-serve-detail">
		<view class="hospital-serve-current">
			<view class="hospital-serve-current-main">
				<view v-for="item in cardLabel" :key="item.fKey" class="card-row">
					<label>{{item.label}}</label>{{routeParams[item.key]||''}}
				</view>
			</view>
			<view class="hospital-serve-current-btn flexR">
				<view v-if="routeParams.sfss==1" @click="onClickPage('operation')">
					手术信息
				</view>
				<view @click="onClickPage('medice')">
					出院带药
				</view>
				<view @click="onClickPage('price')">
					查看费用信息
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				cardLabel:[
					{
						label:'患者姓名：',
						key:'hzxm',
						fKey:'label11'
					},
					{
						label:'患者性别：',
						key:'sex',
						fKey:'label21'
					},
					{
						label:'入院时间：',
						key:'ryrq',
						fKey:'label31'
					},
					{
						label:'出院时间：',
						key:'cysj',
						fKey:'label31'
					},
					{
						label:'科室名称：',
						key:'ksmc',
						fKey:'label4'
					},
					{
						label:'医生名称：',
						key:'ysmc',
						fKey:'label5'
					},
					{
						label:'在院状态：',
						key:'zyztName',
						fKey:'label5'
					},
					{
						label:'预交总额：',
						key:'yjjlj',
						fKey:'label32',
						unit:'元'
					},
					{
						label:'应付金额：',
						key:'zje',
						fKey:'label7',
						unit:'元'
					},
					{
						label:'自付金额：',
						key:'zfje',
						fKey:'label8',
						unit:'元'
					},
				],
				routeParams:''
			}
		},
		onLoad(op) {
			if(op.params){
				this.routeParams = JSON.parse(op.params)
			}else{
				this.routeParams = ''
			}
		},
		methods:{
			onClickPage(type){
				if(type==='price'){
					let res = {
						syxh:this.routeParams.syxh
					}
					uni.navigateTo({
						url:'/pages/Service/HospitalServe/costInfo?params=' + JSON.stringify(res)
					})
				}else if(type==='operation'){
					let res = {
						blh: this.routeParams.blh,
						sfzh: this.routeParams.sfzh
					}
					uni.navigateTo({
						url:'/pages/Home/Operation/index?params=' + JSON.stringify(res)
					})
				}else if(type==='medice'){
					let res = {
						blh: this.routeParams.blh,
						sfzh: this.routeParams.sfzh
					}
					uni.navigateTo({
						url:'/pages/Home/Medicine/index?params=' + JSON.stringify(res)
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.hospital-serve-detail{
		background-color: $uni-bg-color;
		height: calc(100vh);
		.hospital-serve-current{
			background-color: #eee;
			&-main{
				padding: 30rpx;
				background-color: $uni-bg-color;
			}
			&-btn{
				margin-top: 10rpx;
				padding: 20rpx 30rpx;
				background-color: $uni-bg-color;
				width: calc(100vw);
				flex-wrap: wrap;
				>view{
					flex: 1;
					height: 90rpx;
					color: #fff;
					background-color: $theme-color-light;
					min-width: 40%;
					max-width: 100%;
					text-align: center;
					line-height: 90rpx;
					border-radius: 12rpx;
					margin: 10rpx;
				}
			}
		}
	}
</style>
